home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4526 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net   (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: BEGINNER --> problem with ATEXIT !!!!
  5. Date: 5 Feb 1996 16:16:49 GMT
  6. Organization: News & Observer Public Access
  7. Message-ID: <4f5ahh$t5f@castle.nando.net>
  8. References: <its.2.000DC6F8@euronet.nl>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: grail1701.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <its.2.000DC6F8@euronet.nl>, its@euronet.nl (it's_b.v.) writes:
  14. >Can somebody help me with the following :
  15. >
  16. >I use the atexit() function to start a DOS-batchfile when my program ends. 
  17. >The memory which this program uses is freed AFTER the batch-file has 
  18. >completed.   
  19. >
  20. >the program-code looks like this :
  21. >
  22. >void batch( void )
  23. >    {
  24. >       system("\\BATFILE.BAT");
  25. >    }
  26. >
  27. >
  28. >void main( void )
  29. >    {
  30. >       atexit( batch );
  31. >
  32. >       /* my program code */
  33. >
  34. >       exit( 1 );
  35. >    } 
  36. >
  37. >QUESTION :
  38. >Is it possible to free the memory which is used by my program BEFORE the 
  39. >batch-file is executed !
  40.  
  41. I don't see anyway you could accomplish that using the standard library
  42. functions.  If portability is not a major issue, see if the library routines
  43. include the exec() function.  If so, it may suit your needs.
  44.  
  45. Bill McCarthy
  46. actuary@nando.net
  47. Wendell, NC  USA
  48.  
  49.